﻿using System;
using SharpSqlAnalyzer.nodes;
using SharpSqlAnalyzer.pp.para;

namespace SharpSqlAnalyzer.pp.processor.type.comm
{
	// Token: 0x0200024A RID: 586
	public class AbstractProcessor
	{
		// Token: 0x06001311 RID: 4881 RVA: 0x0031C7FA File Offset: 0x0031A9FA
		public virtual void init(GFmtOpt option, params object[] parameters)
		{
			this.option = option;
			this.parameters = parameters;
		}

		// Token: 0x06001312 RID: 4882 RVA: 0x0031C80A File Offset: 0x0031AA0A
		protected internal virtual E getParameter<E>(Type type)
		{
			return this.getParameter<E>(type, 0);
		}

		// Token: 0x06001313 RID: 4883 RVA: 0x0031C814 File Offset: 0x0031AA14
		protected internal virtual E getParameter<E>(Type type, int pos)
		{
			if (this.parameters == null || pos >= this.parameters.Length || this.parameters[pos] == null)
			{
				return default(E);
			}
			if (!type.IsAssignableFrom(this.parameters[pos].GetType()))
			{
				return default(E);
			}
			return (E)((object)this.parameters[pos]);
		}

		// Token: 0x06001314 RID: 4884 RVA: 0x0031C874 File Offset: 0x0031AA74
		public virtual void beforeProcess(TParseTreeNode node)
		{
		}

		// Token: 0x06001315 RID: 4885 RVA: 0x0031C876 File Offset: 0x0031AA76
		public virtual void afterProcess(TParseTreeNode node)
		{
		}

		// Token: 0x06001316 RID: 4886 RVA: 0x0031C878 File Offset: 0x0031AA78
		public virtual void process(TParseTreeNode node)
		{
		}

		// Token: 0x1700034C RID: 844
		// (get) Token: 0x06001317 RID: 4887 RVA: 0x0031C87A File Offset: 0x0031AA7A
		public virtual GFmtOpt Option
		{
			get
			{
				return this.option;
			}
		}

		// Token: 0x040013F6 RID: 5110
		private object[] parameters;

		// Token: 0x040013F7 RID: 5111
		private GFmtOpt option;
	}
}
